//package com.daxt.webservice;
//
//import org.apache.cxf.endpoint.Client;
//import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
//import org.springframework.stereotype.Service;
//
//@Service
//public class AcceptWebServiceClient {
//
//    public static String callWebSV(String wsdUrl, String operationName, String... params) throws Exception {
//
//        JaxWsDynamicClientFactory jaxWsDynamicClientFactory = JaxWsDynamicClientFactory.newInstance();
//        Client client = jaxWsDynamicClientFactory.createClient(wsdUrl);
//
//        //client.getOutInterceptors().add(new ClientLoginInterceptor(USER_NAME, PASS_WORD));
//        Object[] objects;
//
//        // invoke("方法名",参数1,参数2,参数3....);
//        objects = client.invoke(operationName, params);
//
//        return objects[0].toString();
//    }
//
//
//
//    //@Scheduled(cron="*/15 * * * * ?")
//    public  String getMessage(String jsonData) {
//        //在一个方法中连续调用多次WebService接口，每次调用前需要重置上下文。
//        System.out.println("进来了");
//        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
//        Thread.currentThread().setContextClassLoader(classLoader);//在获取连接之前 还原上下文
//
//        System.out.println("======开始调用webservice接口=====");
//
//        String url = "http://10.10.20.77:7502/receives/receiveArchiveRequest?wsdl";
//        String methodName = "receiveArchiveRequest";
//        //System.out.println("Calling" + url);
//        String result="";
//        try {
//            result=callWebSV(url, methodName, jsonData);
//        } catch (Exception e) {
//            e.printStackTrace();
//            return "接口调用失败！！！！";
//        }
//        return "接口调用成功，获得的数据是："+result;
//    }
//
//}
